﻿Option Explicit On

Imports WisSensorNLibLib


Public Class lectorhuella1
    Inherits System.Web.UI.Page

    Private hueya As New MI_hueya.mi_huella
    Private hueya1 As String
    Dim hueya2(0) As String
    Dim prueba As String

    'Public WithEvents m_sensor As New WisSensorNLibLib.WisSensorN



    ' Dim Cant_de_inten_de_lectura As Single






    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not Page.IsPostBack Then
            FG.culturaPaginas()

            'Cant_de_inten_de_lectura = 0


        End If

    End Sub

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim I As Long

        hueya1 = Lector.Dev_cod_de_hulla
        prueba = "CARGADA"

        TextBox1.Text = hueya1



        ''hueya.abrir()
        ''hueya.leerHUya()
        'TextBox1.Text = ""
        'hueya.leerHuella()

        ''------------espero a q lea---------
        'Do
        '    I = I + 1
        'Loop While (hueya.Dev_Cod_huella = "" And I < 200000)
        ''------------------------------------

        'If I >= 200000 Then
        '    hueya.Parar_caputara()
        'Else

        '    TextBox1.Text = hueya.Dev_Cod_huella
        'End If


        'hueya.Cerrar()


        ' ''MI_hueya()

        'm_sensor = New WisSensorN
        'm_sensor.DataEvent = New _IWisSensorNEvents_DataEventEventHandler(AddressOf m_sensor_DataEvent)
        'm_sensor.Open()
        'm_sensor.StartEnroll()

    End Sub
    '  Public Sub m_sensor_DataEvent(ByVal status As WisSensorNLibLib.DATA, ByVal Template As String) Handles m_sensor.DataEvent
    '  Dim index As Integer


    '  TextBox1.Text = Template


    'Select Case status

    '    Case DATA.DATA_ENROLL
    '        txtHuella.Text = Template

    '    Case DATA.DATA_IDENTIFY_CAPTURE

    '        Dim tt As String

    '        tt = txtHuella.Text

    '        index = msensor.Identify(Template, tt)

    '        If index >= 0 Then
    '            MsgBox("Identificada")
    '        Else
    '            MsgBox("no identificada")
    '        End If


    'End Select
    ' End Sub



    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
        '  m_sensor.Close()

        'TextBox1.Text = hueya.DEV_HUELLa
        hueya.Cerrar()






    End Sub




    Private Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
        Dim hueya As New MI_hueya.mi_huella
        Dim m_sensor As New WisSensorN




        If hueya.VerificarHueya(CStr(TextBox1.Text), CStr(TextBox2.Text)) > 0 Then
            MsgBox("es el mismo")

        End If

        m_sensor.Open()
        If m_sensor.Verify(CStr(TextBox1.Text), CStr(TextBox2.Text)) > 0 Then
            MsgBox("es el mismo")
        End If

        If m_sensor.Identify((CStr(TextBox1.Text)), hueya2) >= 0 Then
            MsgBox("es el mismo")
        End If

        m_sensor.Close()

    End Sub

    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
        hueya2(0) = Lector.Dev_cod_de_hulla

        TextBox2.Text = hueya2(0)


    End Sub

    Protected Sub Button5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button5.Click

        txtdni.Text = Lector.IdentificaPersonas_DevuelveDNI

    End Sub

    Protected Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox2.TextChanged

    End Sub
End Class